package xyz.xtt.exchange.aop;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

import lombok.extern.slf4j.Slf4j;

@Slf4j
public class GreetingInterceptor implements MethodInterceptor {
	@Override
	public Object invoke(MethodInvocation methodInvocation) throws Throwable {
		try {
			log.info("调用前...");
			return methodInvocation.proceed();
		} catch (Exception e) {
			log.error("error", e);
			throw e;
		} finally {
			log.info("调用后...");
		}
	}
}